package ru.edu.vstu.atpp.acm.db.utils;

import org.hibernate.SessionFactory;


import org.hibernate.cfg.Configuration;

public class HibernateUtil {
    private static SessionFactory sessionFactory;

    static {
        try {

            Configuration configuration = new Configuration();
            configuration.configure("hibernate.cfg.xml");

            sessionFactory = configuration.buildSessionFactory();


        } catch (Exception e) {
            e.printStackTrace();
            e.getMessage();
            e.toString();
        }
    }

    public static synchronized SessionFactory getSessionfactory() {
        return sessionFactory;
    }
}